package com.sdjzu.university.controller;

import com.sdjzu.university.entity.Professional;
import com.sdjzu.university.service.ProfessionalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class ProfessionalController {
   private final ProfessionalService professionalService;
   public ProfessionalController (ProfessionalService professionalService){
       this.professionalService=professionalService;
   }


    @RequestMapping("/selectp")
    @ResponseBody
    public List<Professional> selectList() {
        return professionalService.selectList();
    }
    @RequestMapping("/insertp")
    @ResponseBody
    public int insert(){
        return professionalService.insert();
    }
    @RequestMapping("/updatep")
    @ResponseBody
    public int update(){
        return professionalService.update();
    }
    @RequestMapping("/deletep")
    @ResponseBody
    public int delete() {return professionalService.delete();}

}
